from pymysql import Connection
conn = Connection(
    host = '127.0.0.1',
    port = 3306,
    user = 'root',
    password = '123456'
)
cursor = conn.cursor()
conn.select_db('world')
# 游标
#cursor.execute("CREATE TABLE sb_list(id int,name varchar(10))")
#cursor.execute("insert into sb_list(id,name) values(2,'牢张');")
cursor.execute("SELECT gender,count(gender) from student where age>10 group by gender")
res = cursor.fetchall()
for x in res:
    print(x)

conn.close()